package cn.wyl.controller;

import cn.wyl.domain.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

//用户服务：暴露接口给订单访问
@RestController
public class UserController {

    //加载端口
    @Value("${server.port}")
    private int port;

    @RequestMapping("/user/{id}")
    public User getById(@PathVariable("id") Long id){


        System.out.println(port);

        return new User(id,"zs","我是zs,port:"+port);
    }
}
